var status = 0;
var eff = "#fEffect/CharacterEff/1112905/0/1#";
var epp = "#fEffect/CharacterEff/1082312/0/0#";
var epp1 = "#fEffect/CharacterEff/1082312/2/0#";
var axx = "#fEffect/CharacterEff/1051294/0/0#";
var xxx = "#fEffect/CharacterEff/1082565/2/0#";
var ppp = "#fEffect/CharacterEff/1112907/4/0#";
var epp3 = "#fEffect/CharacterEff/1112908/0/1#";
var axx1 = "#fEffect/CharacterEff/1062114/1/0#";
var zs = "#fEffect/CharacterEff/1112946/2/0#";
var zs1 = "#fEffect/CharacterEff/1112946/1/1#";
var dxxx = "#fEffect/CharacterEff/1102232/2/0#";
var tz1 = "#fEffect/CharacterEff/1082565/2/0#";
var tz = "#fEffect/CharacterEff/1082565/4/0#";
var tz5 = "#fUI/UIWindow2.img/QuestAlarm/BtQ/normal/0#";
var iconEvent = "#fUI/UIToolTip.img/Item/Equip/Star/Star#";
var ttt2 = "#fUI/UIWindow/Quest/icon6/7#";
var tz2 = "#fEffect/CharacterEff/1082565/0/0#";
var tz3 = "#fEffect/CharacterEff/1082588/0/0#";
var tz4 = "#fEffect/CharacterEff/1082588/3/0#";
var tz51 = "#fEffect/CharacterEff/1082588/1/0#";
var tz6 = "#fEffect/CharacterEff/1112900/2/1#";
var tz7 = "#fEffect/CharacterEff/1112900/3/1#";
var tz8 = "#fEffect/CharacterEff/1112900/4/1#";
var tz88 = "#fEffect/CharacterEff/1112900/5/1#";
var tz9 = "#fEffect/CharacterEff/1112902/0/0#";
var tz10 = "#fEffect/CharacterEff/1112903/0/0#";
var tz11 = "#fEffect/CharacterEff/1112904/0/0#";
var tz12 = "#fEffect/CharacterEff/1112924/0/0#";
var tz13 = "#fEffect/CharacterEff/1112925/0/0#";
var tz14 = "#fEffect/CharacterEff/1112926/0/0#";
var tz15 = "#fEffect/CharacterEff/1112949/0/0#";
var tz16 = "#fEffect/CharacterEff/1112949/1/0#";
var tz17 = "#fEffect/CharacterEff/1112949/2/0#";
var tz18 = "#fEffect/CharacterEff/1112949/3/0#";
var tz19 = "#fEffect/CharacterEff/1112949/4/0#";
var tz20 = "#fEffect/CharacterEff/1114000/1/0#";
var yun = "#fUI/UIWindow/PartySearch2/BtNext/mouseOver/0#";
var wn1 = "#fUI/Basic.img/BtClaim/normal/0#";
var wn2 = "#fUI/UIWindowTW.img/TimeCapsule/BtClose/disabled/0#";
var wn3 = "#fUI/Basic.img/ComboBox/disabled/1#";
var wn4 = "#fUI/Basic.img/ComboBox3/mouseOver/1#";
var wn5 = "#fUI/Basic.img/Cursor/17/16#";
var wn6 = "#fUI/Basic.img/Cursor/34/0#";
var wn7 = "#fUI/Basic.img/Cursor/43/3#";
var wn8 = "#fUI/CashShop.img/CSBargainSale/BtLeft/normal/0#";
var wn9 = "#fUI/CashShop.img/CSBargainSale/BtRight/normal/0#";
var wn10 = "#fUI/CashShop.img/CSBeauty/tip/hair#";
var wn11 = "#fUI/CashShop.img/CSBeauty/hairColor/Enable/0#";
var wn12 = "#fUI/CashShop.img/CSBeauty/hairColor/Enable/1#";
var wn13 = "#fUI/CashShop.img/CSBeauty/hairColor/Enable/2#";
var wn14 = "#fUI/CashShop.img/CSBeauty/hairColor/Enable/3#";
var wn15 = "#fUI/CashShop.img/CSBeauty/hairColor/Enable/4#";
var wn16 = "#fUI/CashShop.img/CSBeauty/hairColor/Enable/5#";
var wn17 = "#fUI/CashShop.img/CSBeauty/hairColor/Enable/6#";
var wn18 = "#fUI/CashShop.img/CSBeauty/hairColor/Enable/7#";
var wn19 = "#fUI/CashShop.img/CSEffect/event/0#";
var wn20 = "#fUI/CashShop.img/CSEffect/hot/0#";
var wn21 = "#fUI/CashShop.img/CSEffect/mileage/0#";
var wn22 = "#fUI/CashShop.img/CSEffect/new/0#";
var wn23 = "#fUI/CashShop.img/CSEffect/sale/0#";
var wn24 = "#fUI/CashShop.img/CSEffect/time/0#";
var wp1 = "#fUI/CashShop.img/CSEffect/number/0#";
var wp2 = "#fUI/CashShop.img/CSIcon/0#";
var wp3 = "#fUI/CashShop.img/CSStatus/BtCharge/mouseOver/0#";
var wp4 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/0#";
var wp5 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/1#";
var wp6 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/2#";
var wp7 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/3#";
var wp8 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/4#";
var wp9 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/5#";
var wp10 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/6#";
var wp11 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/7#";
var wp12 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/8#";
var wp13 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/9#";
var wp14 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/10#";
var wp15 = "#fUI/mapleBingo.img/mapleBingo/lineAni/0/0#";
var wp16 = "#fUI/mapleBingo.img/mapleBingo/lineAni/0/1#";
var wp17 = "#fUI/mapleBingo.img/mapleBingo/lineAni/0/2#";
var wp18 = "#fUI/mapleBingo.img/mapleBingo/lineAni/0/3#";
var wp19 = "#fUI/mapleBingo.img/mapleBingo/lineAni/0/4#";
var wp20 = "#fUI/mapleBingo.img/mapleBingo/lineAni/0/5#";
var wi1 = "#fUI/SoulUI.img/DungeonMap/icon/dungeonItem/0#";
var wi2 = "#fUI/SoulUI.img/DungeonMap/icon/soulFragment/0#";
var wi3 = "#fUI/SoulUI.img/DungeonMap/icon/soulTrap/0#";
var wi4 = "#fUI/SoulUI.img/DungeonMap/icon/warpGate/0#";
var wi5 = "#fUI/SoulUI.img/DungeonParty/backgrnd2#";
var wi6 = "#fUI/StarCityUI.img/Board_Friend/list/0/5/selected#";
var wi7 = "#fUI/StarCityUI.img/Board_GameRank/tab/enabled/0#";
var wi8 = "#fUI/StarCityUI.img/Board_GameRank/user/myrank#";
var wi9 = "#fUI/StarCityUI.img/Board_GameRank/user/shining#";
var wi11 = "#fUI/UIPVP.img/ChampionMark/4#";
var wi12 = "#fUI/UIPVP.img/DmgEffect/DmgRed/excellentCritical#";
var wi13 = "#fUI/UIPVP.img/DmgEffect/DmgBlue/excellentCritical#";
var wi14 = "#fUI/UIPVP.img/MiniMapIcon/star#";
var wi15 = "#fUI/UIToolTip.img/Item/Equip/Star/Star1#";
var yun1 = "#fUI/UIWindow/Quest/icon7/10#";
var wn60 = "#fMob/0100101.img/die1/1#";
var ca = java.util.Calendar.getInstance();
var year = ca.get(java.util.Calendar.YEAR);
var month = ca.get(java.util.Calendar.MONTH) + 1;
var day = ca.get(java.util.Calendar.DATE);
var hour = ca.get(java.util.Calendar.HOUR_OF_DAY);
var minute = ca.get(java.util.Calendar.MINUTE);
var second = ca.get(java.util.Calendar.SECOND);
var weekday = ca.get(java.util.Calendar.DAY_OF_WEEK);

function start() {
    status = -1;
    action(1, 0, 0)
}

function action(d, b, a) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    if (d == 1) {
        status++
    } else {
        status--
    }
    if (cm.getMapId() == 180000001) {
        cm.sendOk("很遗憾，您因为违反用户守则被禁止游戏活动，如有异议请联系管理员.");
        cm.dispose()
    } else {
        if (status == 0) {
            var c = "#d今日已刷废弃：#r" + cm.getEventCount("废弃都市") + "#d次\r\n";
            c += "#e#L1#废弃组队通关50次领取#v5062002#80个，#v5062500#50个#l\r\n";
            c += "#e#L2#废弃组队通关100次领取#v4001839#100个#l\r\n";
            cm.askMenu(c)
        } else {
            if (status == 1) {
                switch (a) {
                    case 0:
                        cm.dispose();
                        cm.openShop(1012123);
                        break;
                    case 1:
                        if (cm.getEventCount("废弃都市") >= 50 && cm.getBossLogAcc("废弃通关50奖励") < 1) {
                            cm.setBossLogAcc("废弃通关50奖励");
                            cm.gainItem(5062002, 80);
                            cm.gainItem(5062500, 50);
                            cm.sendOk("领取成功，获得#v5062002#80个，#v5062500#50个");
                            cm.worldSpouseMessage(32, "『废弃组队』 : 恭喜" + cm.getPlayer().getName() + ",领取了废弃通过50次奖励。");
                            cm.dispose()
                        } else {
                            cm.sendOk("#r领取失败，通关不足");
                            cm.dispose()
                        }
                        break;
                    case 2:
                        if (cm.getEventCount("废弃都市") >= 100 && cm.getBossLogAcc("废弃通关100奖励") < 1) {
                            cm.setBossLogAcc("废弃通关100奖励");
                            cm.gainItem(4001839, 100);
                            cm.sendOk("领取成功，获得#v4001839#100个");
                            cm.worldSpouseMessage(32, "『废弃组队』 : 恭喜" + cm.getPlayer().getName() + ",领取了废弃通过100次奖励。");
                            cm.dispose()
                        } else {
                            cm.sendOk("#r领取失败，通关不足");
                            cm.dispose()
                        }
                        break;
                    case 3:
                        cm.dispose();
                        cm.openNpc(9900004, 6);
                        break;
                    case 4:
                        cm.dispose();
                        cm.openShop(22224);
                        break;
                    case 5:
                        cm.dispose();
                        cm.openShop(9310117);
                        break;
                    case 6:
                        cm.dispose();
                        cm.openShop(1033001);
                        break;
                    case 7:
                        cm.dispose();
                        cm.openShop(2161010);
                        break;
                    case 8:
                        cm.dispose();
                        cm.openNpc(9900003, 21);
                        break;
                    case 9:
                        cm.dispose();
                        cm.openNpc(9310144, 222);
                        break;
                    case 10:
                        cm.dispose();
                        cm.openShop(22200);
                        break;
                    case 11:
                        cm.dispose();
                        cm.openShop(20000);
                        break;
                    case 12:
                        cm.dispose();
                        cm.openNpc(9310073);
                        break;
                    case 13:
                        cm.dispose();
                        cm.openNpc(9900003, 16);
                        break;
                    case 14:
                        cm.dispose();
                        cm.openNpc(9900002, 11);
                        break;
                    case 15:
                        cm.dispose();
                        cm.openNpc(9900002, 10);
                        break;
                    case 16:
                        cm.dispose();
                        cm.openNpc(9310071);
                        break;
                    case 17:
                        cm.dispose();
                        cm.openNpc(9310072);
                        break;
                    case 18:
                        cm.dispose();
                        cm.openNpc(9900003, 10);
                        break;
                    case 19:
                        cm.dispose();
                        cm.openNpc(9000069, 5);
                        break;
                    case 20:
                        cm.dispose();
                        cm.openNpc(9000069, 1);
                        break;
                    case 21:
                        cm.dispose();
                        cm.openNpc(9000069, 2);
                        break;
                    case 22:
                        cm.dispose();
                        cm.openNpc(9000069, 4);
                        break;
                    case 23:
                        cm.dispose();
                        cm.openNpc(9000069, 3);
                        break;
                    case 24:
                        cm.dispose();
                        cm.openNpc(9310144, 999);
                        break;
                    case 25:
                        if (cm.getMeso() >= 100000) {
                            cm.gainMeso(-100000);
                            cm.gainItem(2500000, 1);
                            cm.sendOk("恭喜您购买成功!!!")
                        } else {
                            cm.sendOk("需要100000金币,你没有!!!")
                        }
                        cm.dispose();
                        break;
                    case 50:
                        cm.dispose();
                        cm.openNpc(9310144, 101);
                        break;
                    case 26:
                        cm.dispose();
                        cm.openNpc(9900004, 8);
                        break;
                    case 27:
                        cm.dispose();
                        cm.openNpc(9900004, 9);
                        break;
                    case 28:
                        cm.dispose();
                        cm.openNpc(9900004, 10);
                        break;
                    case 29:
                        cm.dispose();
                        cm.openNpc(9900004, 11);
                        break;
                    case 30:
                        cm.dispose();
                        cm.openNpc(9900004, 12);
                        break
                }
            }
        }
    }
};